<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Info</title>
        <script type="text/javascript">
        function echeck(str) {

            var at = "@"
            var dot = "."
            var lat = str.indexOf(at)
            var lstr = str.length
            var ldot = str.indexOf(dot)
            if (str.indexOf(at) == -1) {
                alert("Invalid E-mail ID")
                return false
            }

            if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
                alert("Invalid E-mail ID")
                return false
            }

            if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
                alert("Invalid E-mail ID")
                return false
            }

            if (str.indexOf(at, (lat + 1)) != -1) {
                alert("Invalid E-mail ID")
                return false
            }

            if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
                alert("Invalid E-mail ID")
                return false
            }

            if (str.indexOf(dot, (lat + 2)) == -1) {
                alert("Invalid E-mail ID")
                return false
            }

            if (str.indexOf(" ") != -1) {
                alert("Invalid E-mail ID")
                return false
            }

            return true
        }

        function ValidateForm() {
            var emailID = document.f.username

            if ((emailID.value == null) || (emailID.value == "")) {
                alert("Please Enter your Email ID")
                emailID.focus()
                return false
            }
            if (echeck(emailID.value) == false) {
                emailID.value = ""
                emailID.focus()
                return false
            }

            return true

        }
        </script>
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/1.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/2.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/3.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/4.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/5.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/6.css" />
<link type="text/css" rel="stylesheet" href="/bob-web/CSS/7.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/3c-lcrc-static-pp-layout.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/3c-lcrc-static-pp-presentation.css" />
<link rel="stylesheet" type="text/css" href="/bob-web/CSS/2FEu-VTjHxG.css" />
</head>
<body class="profile">
<!-- left column -->
<div id="lh-col"><br />
  <%@ include file="/WEB-INF/jsp/leftScreen.jsp" %>
</div>
<!-- end of left column -->
<!-- center column -->

    <!-- Tabs -->
     <%@ include file="/WEB-INF/jsp/tabs.jsp" %>
     <!-- End of tabs -->



  <div id="reg_box">
    <div id="reg_form_box" class= "large_box">
      <form action="/bob-web/service/myInfo.htm" method="POST" name="f" onsubmit="return ValidateForm()">
          <p align="left"><font color="red"><c:out value="${model.updatedMessage}"/></font></p>
        <table width="90%" border="0" cellpadding="5">
          <tr>
            <td class= "label">Name</td>
            <td><input type='text' class='inputtext' id='name' name='name' size="40" value='${model.user.name}'
                     <c:if test="${!model.himself}">readonly="readonly"</c:if>
                       /></td>
            <td class= "label" align="left">Conferences</td>
          </tr>
          <tr>
            <td class= "label">Surname</td>
            <td><input type='text' class='inputtext' id='surname' name='surname' size="40" value='${model.user.surname}'
                   <c:if test="${!model.himself}">readonly="readonly"</c:if>
                      /></td>
            <td rowspan="4"  align="left"><textarea name='conferences' rows="10" cols="36" <c:if test="${!model.himself}"> readonly="readonly"</c:if>>${model.user.userInfo.conferences}</textarea></td>
          </tr>
          <tr>
            <td class= "label">Email</td>
            <td><input type='text' class='inputtext' id='username' name='username' size="40" value='${model.user.username}'
              <c:if test="${!model.himself}">readonly="readonly"</c:if>
              /></td>
          </tr>
          <tr>
            <td class= "label">Password</td>
            <td><c:if test="${model.himself}">
                <input type='password' class='inputtext' id='password' name='password' size="30"/>
              </c:if></td>
          </tr>
          <tr>
            <td class= "label">Confirm Password</td>
            <td><c:if test="${model.himself}">
                <input type='password' class='inputtext' id='repassword' name='repassword' size="30"/>
              </c:if></td>
          </tr>
          <tr>
            <td class= "label">Birthdate (Format: yyyy-MM-dd)</td>
            <td><input type='text' class='inputtext' id='birthday' name='birthday' value='${model.user.userInfo.birthday}'
              <c:if test="${!model.himself}">readonly="readonly"</c:if>
              /></td>
            <td class= "label"  align="left"></td>
          </tr>
          <tr>
            <td class= "label">GSM</td>
            <td><input maxlength="44" type='text' class='inputtext' id='gsm' name='gsm' value='${model.user.userInfo.gsm}'
              <c:if test="${!model.himself}">readonly="readonly"</c:if>
              /></td>
            <td rowspan="3"  align="left"></td>
          </tr>
          <tr>
            <td class= "label">Hobbies</td>
            <td><textarea name='hobbies' rows="3" cols="36" <c:if test="${!model.himself}"> readonly="readonly"</c:if>>${model.user.userInfo.hobbies}</textarea></td>
          </tr>
          <tr>
            <td class= "label">Interests</td>
            <td><textarea name='interests' rows="3" cols="36" <c:if test="${!model.himself}"> readonly="readonly"</c:if>>${model.user.userInfo.interests}</textarea></td>
          </tr>
          <c:if test="${model.himself}">
             <!--<tr>
              <td class= "label">Profile Picture    </td>
                   <td>
                  <input name="profilefile" type="file">
                   </td>
                  </tr>   -->
            <tr>
              <td colspan="2"><label class="uiButton uiButtonSpecial uiButtonMedium">
                <input value="Save" name="submit" type="submit">
                </label>
              </td>
            </tr>
          </c:if>
        </table>
      </form>
    </div>
  </div>
</div>
<!-- end of center column -->
<!-- right column -->
<div id="rh-col"> <a href="/bob-web/service/homePage.htm"><img border="0" src="/bob-web/Images/logo.png" alt="BookOfBoun" width="180" height="100" /></a>
  <%@ include file="/WEB-INF/jsp/rightScreen.jsp" %>
</div>
<!-- end of right column -->
</body>
</html>
